
var initState = {
  sum: 2
}
export default (state = initState, action) => {
  var { type, data } = action;
  switch (type) {
    case "jia":
      return {...state,sum:state.sum + data}
    case "jian":
      return {...state,sum:state.sum - data}
    default:
      return state
  }
}
